package com.vincent.gdb.test.inject;

import com.google.inject.Guice;
import com.google.inject.Injector;


public class InjectionFactory {

	private static Injector injector = Guice.createInjector(new InjectionModule(),new LifecycleModule());;
	public static Injector getInjector() {
		if (injector == null) {
			synchronized (InjectionFactory.class) {
				if (injector == null) {
					injector = Guice.createInjector(new InjectionModule(),new LifecycleModule());
				}
			}			
		}
		
		return injector;
	}

	protected static void setInjector(Injector injectee) {
		injector = injectee;
	}
}
